import time

from selenium import webdriver
from selenium.webdriver.common.by import By

# 1.打开浏览器
from selenium.webdriver.common.keys import Keys
# 创建浏览器对象
driver = webdriver.Chrome()
# 2.输入访问地址（URL）
url = r"http://121.43.169.97:8848/pageA.html"
driver.get(url)
# 放大浏览器页面
driver.maximize_window()
# 暂停2秒
time.sleep(2)

# 需求：打开“注册A页面.html”，完成一下操作
#1.填写注册信息
driver.find_element(By.CSS_SELECTOR, "#userA").send_keys("admin")
#2.截图保存
# driver.get_screenshot_as_file("../img/%s.png" %(time.strftime("%Y_%m_%d_%H_%M_%S")))
driver.get_screenshot_as_file("../img/{}.png" )





# 暂停2秒
time.sleep(2)

